import request from "@/utils/request";

const API = {
    QUERY_PRIMARY_CATEGORY: '/subject/subject/category/queryPrimaryCategory', // 查询父分类
    QUERY_CATEGORY_BY_PRIMARY: '/subject/subject/category/queryCategoryByPrimary', // 查询父分类下的子分类 （二级分类）
    QUERY_CATEGORY_AND_LABEL: '/subject/subject/category/queryCategoryAndLabel', // 查询子分类及标签
    SUBJECT_PAGE: '/subject/subject/getSubjectPage', // 查询题目列表
    QUERY_SUBJECT_INFO: '/subject/subject/querySubjectInfo', // 查询题目详情
    UPDATE_SUBJECT_INFO: '/subject/subject/update', // 更新题目信息
    UPDATE_SUBJECT_STATUS: '/subject/subject/updateSubjectStatus', // 修改题目状态
    GET_SUBJECT_BY_MYSELF: '/subject/subject/getSubjectByMySelf', // 查询自己出的题目
    ADD_SUBJECT: '/subject/subject/add', // 新增题目信息
    QUERY_CONTRIBUTE_LIST: '/subject/subject/getContributeList', // 查询查询刷题贡献榜
}

export const queryPrimaryCategory = (data) => request.post(API.QUERY_PRIMARY_CATEGORY, data)

export const queryCategoryByPrimary = (data) => request.post(API.QUERY_CATEGORY_BY_PRIMARY, data)

export const queryCategoryAndLabel = (data) => request.post(API.QUERY_CATEGORY_AND_LABEL, data)

export const getSubjectPage = (data) => request.post(API.SUBJECT_PAGE, data)

export const querySubjectInfo = (data) => request.post(API.QUERY_SUBJECT_INFO, data)

export const updateSubjectInfo = (data) => request.post(API.UPDATE_SUBJECT_INFO, data)

export const updateSubjectStatus = (data) => request.post(API.UPDATE_SUBJECT_STATUS, data)

export const reqSubjectByMySelf = (data) => request.post(API.GET_SUBJECT_BY_MYSELF, data)

export const reqAddSubject = (data) => request.post(API.ADD_SUBJECT, data)

export const reqContributeList = () => request.get(API.QUERY_CONTRIBUTE_LIST)

